<template>
	<div style="border:1px solid orange;margin: 5px; ">
		<h2>One</h2>
		<Two></Two>
		<h3>val:{{val}}</h3>
		<h3>str:{{str}}</h3>
		<input type="text" v-model="str">
	</div>
</template>

<script>
	import {inject,provide} from 'vue'
	import Two from './Two.vue'
	export default{
		components:{
			Two
		},
		setup(){
			const val = inject('globalVal');
			const str = inject('globalStr');
			
			provide('globalOne','这是One组件传递过来的值')
			return{
				val,str
			}
		}
	}
</script>

<style>
</style>
